<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="/static/css/main.css">
</head>
<body>
	<section id="page-home">
		<div class="blog-content">
			<div class="blog-heading">
				<div class="title">{{title}}</div>
			</div>
			<div class="blog-body">{{content}}</div>
		</div>
	</section>
</body>
<script type="text/javascript" src="/static/js/jquery.min.js"></script>
<script type="text/javascript" src="/static/js/vue.js"></script>
<script type="text/javascript" src="/static/js/date.js"></script>

<script type="text/javascript">
	var vm = new Vue({
	    el: '#page-home',
	    //需要注入的模板的父元素
	    data: {
	        title:'',
	        content:''
	    }, 
	    created: function () {
	    	let url = window.location.href;
	        $.get("/article/details",
	        		{id:url.substring(url.lastIndexOf('/')+1)},
	        		function (data) {
	            vm.title = data.title;
	            vm.content = data.content;
	        });
	    },
	    filters: {
	        formatDate(time) {
	            var date = new Date(time);
	            return formatDate(date, 'yyyy-MM-dd hh:mm');
	        }
	    }
	});
	
	function asd(){
		alert(1)
	}
</script>
</html>